<template>
	<div id="register">
		<el-form tag="form" id="form" :model="form">
			用户名:
			<el-input placeholder="请输入用户名" v-model="form.username"></el-input>
			密码:
			<el-input placeholder="请输入密码" v-model="form.pwd" type="password"></el-input>
			密码:
			<el-input placeholder="请再次请输入密码" v-model="form.pwd" type="password"></el-input>
			<p>
				<el-button @click="register" type="primary">立即注册</el-button>
				<el-button @click="$router.push('/home/login')" type="info">返回登陆页面</el-button>
			</p>
		</el-form>
	</div>
</template>

<script type="text/javascript">
export default {
	data() {
		return {
			form: {
				username: "admin",
				pwd: 123456
			}
		}
	},
	methods: {
		register() {
			window.localStorage.setItem('username', this.form.username)
			alert("注册成功");
			$("input").val("");
		}
	}
}
</script>

<style scoped>
#register {
	margin: 50px auto;
	text-align: center;
	width: 500px;
}

p {
	margin-top: 30px;
}
</style>
